import 'package:json_annotation/json_annotation.dart';

part 'coin.g.dart';

@JsonSerializable()
class GoldCoinModel {
  /// 1 = 收入， 2= 支出
  int type;

  int count;

  String time;

  String name;

  GoldCoinModel({this.type = 1, required this.count, required this.name, required this.time});

  factory GoldCoinModel.fromJson(Map<String, dynamic> json) => _$GoldCoinModelFromJson(json);

  Map<String, dynamic> toJson() => _$GoldCoinModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}

enum GoldCoinTypeEnum {
  income(label: '收入', value: 1),
  out(label: '支出', value: 2);

  final String label;
  final int value;

  const GoldCoinTypeEnum({required this.label, required this.value});
}
